<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.lmpop.frame.dao.MenuInfo"%>
<%@page import="com.lmpop.trade.ti_admin.Ti_adminInfo"%>
<%@page import="com.lmpop.trade.sms.SendMail"%>
<%@page import="com.lmpop.trade.ti_personal.Ti_personalInfo"%>
<%@page import="com.lmpop.trade.ti_address.Ti_addressInfo"%>
<%@page import="java.net.URLDecoder"%>
  <%
  	request.setCharacterEncoding("UTF-8");
  	String subject="";
  	if(request.getParameter("subject")!=null&&!"".equals(request.getParameter("subject")))
  		subject =URLDecoder.decode(request.getParameter("subject"),"UTF-8");
  	String content="";
  	if(request.getParameter("content")!=null&&!"".equals(request.getParameter("content")))
  		content=request.getParameter("content");
  	String user_id="";
  	if(request.getParameter("user_id")!=null&&!"".equals(request.getParameter("user_id")))
  		user_id=request.getParameter("user_id");
  	String cust_id="";
  	if(request.getParameter("cust_id")!=null&&!"".equals(request.getParameter("cust_id")))
  		cust_id=request.getParameter("cust_id");
 	Ti_adminInfo adminInfo=new Ti_adminInfo();
 	String to_email=adminInfo.getEmailByPk(user_id);
 	//Ti_personalInfo personal=new Ti_personalInfo();
 	//String from_email=personal.getEmailByPk(cust_id);
 	//Ti_addressInfo addressInfo=new Ti_addressInfo();
 	//String from_email=addressInfo.getEmailByPk(cust_id);
	String from_email="";
 	if(from_email.equals("0")){
 		out.print("请完善您的账户邮箱");
 	}else{
 		if(to_email.equals("0")){
 		out.print("该商家没有注册邮箱");
 	}else{
 		int result=SendMail.SendEmail(from_email,to_email, subject, content);
 		if(result==1)
 			out.print("邮件发送成功");
 		else
 			out.print("邮件发送失败");	
 	}
 	} 
 		
   %>
